#include<stdlib.h>
#include<stdio.h>
#include<sys/types.h>
#include<sys/stat.h>
#include<unistd.h>
#include<wait.h>

int main(int argc,char **argv){

    pid_t pid;

    printf("%d beging... \n",getpid());
    // fflush(NULL);
    // execl("/bin/date","date","+%F_%T",NULL);
    pid = fork();
    if (pid == 0)
    {
        execl("/bin/date","date","+%F_%T",NULL);
        perror("出错了...");
    }else if(pid > 0){

         wait(NULL);
        printf(" 主进程执行完了... \n");
        
    }
   
    // printf(" 主程序执行完... \n");
    
    
    
    
   return 0;
}